Linux 后门应急
1
主机后门用户名称:提交格式如:
flag{backdoor}
检查 /etc/passwd
文件,发现
backdoor:x:0:0:root:/root:/bin/bash
即可确定答案
flag{backdoor}
2
主机排查项中可以发现到 flag 内以 i 开头的 flag,如
flag{ixxxxxxx}
上传 linpeas.sh
进行排查,发现进程信息中有以下记录
root 498 0.0 0.1 6724 3212 ? S 20:17 0:00 bash
root 505 0.0 0.0 2368 1696 ? S 20:17 0:00 _ nc -lvp 9999 -c flag{infoFl4g}
即可确定答案
flag{infoFl4g}
3
主机排查发现 9999 端口是通过哪个配置文件如何开机启动的,如
/etc/crontab
则填写/etc/crontab
的 md5 ,提交方式示例:flag{md5}
检查进程信息
(remote) user@ip-10-0-10-4:/home/user$ ps -o ppid= -p 498
1
root 1 0.0 0.4 103896 10056 ? Ss 20:15 0:01 /sbin/init
那么说明,该进程由 init
或 systemd
启动的
systemctl status
● ip-10-0-10-4
State: degraded
Jobs: 0 queued
Failed: 1 units
Since: Thu 2024-11-14 20:15:19 EST; 40min ago
CGroup: /
└─system.slice
├─rc-local.service
│ ├─498 bash
│ └─14393 nc -lvp 9999 -c flag{infoFl4g}
查看服务状态
(remote) user@ip-10-0-10-4:/home/user$ systemctl status rc-local.service
● rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/etc/systemd/system/rc-local.service; enabled; vendor preset: enabled)
Drop-In: /usr/lib/systemd/system/rc-local.service.d
└─debian.conf
Active: active (running) since Thu 2024-11-14 20:17:15 EST; 44min ago
Process: 489 ExecStart=/etc/rc.d/rc.local start (code=exited, status=0/SUCCESS)
Main PID: 498 (bash)
Tasks: 2 (limit: 2356)
Memory: 8.9M
CGroup: /system.slice/rc-local.service
├─ 498 bash
└─14393 nc -lvp 9999 -c flag{infoFl4g}
查看服务文件,找到
/etc/rc.d/rc.local
#!/bin/bash
echo d2hpbGUgdHJ1ZTtkbyBub2h1cCBuYyAtbHZwIDk5OTkgLWMgImZsYWd7aW5mb0ZsNGd9IiAyPiYxIDtzbGVlcCAxO2RvbmU7 | base64 -d | nohup bash &
exit 0
计算路径哈希
/etc/rc.d/rc.local -> cf8a978fe83579e2e20ec158524d8c06